package com.qingke.besuper.pojo;


public class Question{
	private int id;
	private String context;
	private int credit;
	private int playerId;
	private boolean isOpen;
	private int bestAnswerId;
	
	public Question(){
		id=-1;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getContext() {
		return context;
	}
	public void setContext(String context) {
		this.context = context;
	}
	public int getCredit() {
		return credit;
	}
	public void setCredit(int credit) {
		this.credit = credit;
	}
	public int getPlayerId() {
		return playerId;
	}
	public void setPlayerId(int playerId) {
		this.playerId = playerId;
	}
	public boolean isOpen() {
		return isOpen;
	}
	public void setOpen(boolean isOpen) {
		this.isOpen = isOpen;
	}
	public int getBestAnswerId() {
		return bestAnswerId;
	}
	public void setBestAnswerId(int bestAnswerId) {
		this.bestAnswerId = bestAnswerId;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + bestAnswerId;
		result = prime * result + ((context == null) ? 0 : context.hashCode());
		result = prime * result + credit;
		result = prime * result + id;
		result = prime * result + (isOpen ? 1231 : 1237);
		result = prime * result + playerId;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Question other = (Question) obj;
		if (bestAnswerId != other.bestAnswerId)
			return false;
		if (context == null) {
			if (other.context != null)
				return false;
		} else if (!context.equals(other.context))
			return false;
		if (credit != other.credit)
			return false;
		if (id != other.id)
			return false;
		if (isOpen != other.isOpen)
			return false;
		if (playerId != other.playerId)
			return false;
		return true;
	}

}
